package spec.lijunyao.unit5.collection;

import java.util.HashMap;

/*
*Map类测试
*/
public class MapTest {
    public static void main(String[] args) {
        HashMap hm=new HashMap();
        System.out.println("刚初始化的时候Map元素数量："+hm.size());
        hm.put("丁一","王五");
        hm.put("赵二","黄六");
        hm.put("张三","宋七");
        hm.put("张三","谈八");
        System.out.println("添加了四对元素后Map元素的数量："+hm.size());
        String s=(String)hm.get("张三");
        System.out.println(s);
        hm.put("秦四","王五");
        System.out.println(hm.get("丁一"));
        System.out.println(hm.get("秦四"));



    }
}
